<?php

namespace Common\Model;

/**
 * BpassLoginModel.class实例模型
 * 
 * @author songanwei
 * @date 2016-1-4
 */
class BpassLoginModel extends BaseModel {

    protected $trueTableName = 'tb_bpass_login';

    /**
     * 用户名返回数据
     * @modify songanwei 2016-01-04
     * @param string $adminName
     * @return type
     */
    public function getInfoByName($adminName) {
        return $this->where(array('name' => $adminName))->find();
    }

    /**
     * 更新密码
     * @modify songanwei 2016-03-17
     * @param integer $adminId  管理员ID
     * @param string $password 加密密码
     */
    public function setPassword($adminId, $password) {
        $result = $this->where(array('id' => $adminId))->save(array('password' => $password));
        return $result === false ? false : true;
    }

}
